import { defineStore } from 'pinia';

import { Local } from '/@/utils/storage';

export const useBasicInfo = defineStore('basicInfo', {
	state: () => ({
		goodsInfo: Local.get('goodsInfo') || {},
	}),
	actions: {
		setGoodsInfo(data: Object) {
			Local.set('goodsInfo', data);
			this.goodsInfo = data;
		},
		removeGoodsInfo() {
			Local.remove('goodsInfo');
			this.goodsInfo = {};
		},
	},
});
